import 'package:flutter/material.dart';
import 'package:x_common_utils/utils/inkWell_util.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:xinxuan/utils/color_util.dart';

class SystemAddressItem extends StatelessWidget {

  final String title;
  final Function onTap;
  final bool isSelected;
  SystemAddressItem({
    required this.title,
    required this.onTap,
    this.isSelected = false
  });

  @override
  Widget build(BuildContext context) {
    return InkWellUtil.shakeProofInkWell(Container(
      padding: EdgeInsets.symmetric(horizontal: 12.w),
      color: bgWhiteColor,
      child: Container(
        height: 54.h,
        padding: EdgeInsets.symmetric(horizontal: 4.w),
        decoration: BoxDecoration(
          border: Border(
            bottom: BorderSide(
              width: .5,
              color: lineColor
            )
          )
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              title,
              style: TextStyle(
                color: textBlackColor,
                fontSize: 16.sp
              ),
            ),
            Image.asset(
              isSelected ? 'assets/icons/icon_radio_fill.png' : 'assets/icons/icon_radio_line.png',
              width: 20.w,
              height: 20.w,
            )
          ],
        ),
      ),
    ), () => onTap());
  }
}